.include "asm/include/battle_commands.inc"

.data

_000:
    PlayBattleAnimationOnMons BATTLER_CATEGORY_MSG_ATTACKER, BATTLER_CATEGORY_MSG_DEFENDER, BATTLE_ANIMATION_DAMAGE_LEECH_SEED
    Wait 
    UpdateMonDataFromVar OPCODE_GET, BATTLER_CATEGORY_MSG_DEFENDER, BMON_DATA_MAXHP, BSCRIPT_VAR_HP_CALC
    DivideVarByValue BSCRIPT_VAR_HP_CALC, 8
    UpdateVar OPCODE_MUL, BSCRIPT_VAR_HP_CALC, -1
    UpdateVar OPCODE_FLAG_ON, BSCRIPT_VAR_BATTLE_STATUS, BATTLE_STATUS_NO_BLINK
    UpdateVarFromVar OPCODE_SET, BSCRIPT_VAR_MSG_BATTLER_TEMP, BSCRIPT_VAR_MSG_DEFENDER
    Call BATTLE_SUBSCRIPT_UPDATE_HP
    UpdateVarFromVar OPCODE_SET, BSCRIPT_VAR_HP_CALC, BSCRIPT_VAR_HIT_DAMAGE
    CheckItemHoldEffect CHECK_OPCODE_NOT_HAVE, BATTLER_CATEGORY_MSG_ATTACKER, HOLD_EFFECT_LEECH_BOOST, _050
    GetItemEffectParam BATTLER_CATEGORY_MSG_ATTACKER, BSCRIPT_VAR_CALC_TEMP
    UpdateVar OPCODE_ADD, BSCRIPT_VAR_CALC_TEMP, 0x00000064
    UpdateVarFromVar OPCODE_MUL, BSCRIPT_VAR_HP_CALC, BSCRIPT_VAR_CALC_TEMP
    UpdateVar OPCODE_DIV, BSCRIPT_VAR_HP_CALC, 100

_050:
    UpdateVarFromVar OPCODE_SET, BSCRIPT_VAR_MSG_BATTLER_TEMP, BSCRIPT_VAR_MSG_ATTACKER
    UpdateVar OPCODE_FLAG_ON, BSCRIPT_VAR_BATTLE_STATUS, BATTLE_STATUS_NO_BLINK
    CheckAbility CHECK_OPCODE_HAVE, BATTLER_CATEGORY_MSG_DEFENDER, ABILITY_LIQUID_OOZE, _096
    CompareMonDataToValue OPCODE_NEQ, BATTLER_CATEGORY_MSG_TEMP, BMON_DATA_HEAL_BLOCK_TURNS, 0, _083
    UpdateVar OPCODE_MUL, BSCRIPT_VAR_HP_CALC, -1
    Call BATTLE_SUBSCRIPT_UPDATE_HP
    // {0}’s health is sapped by Leech Seed!
    PrintMessage 296, TAG_NICKNAME, BATTLER_CATEGORY_MSG_DEFENDER
    Wait 
    WaitButtonABTime 30
    Call BATTLE_SUBSCRIPT_SWITCH_IN_ABILITY_CHECK
    End 

_083:
    UpdateVar OPCODE_SET, BSCRIPT_VAR_MSG_MOVE_TEMP, MOVE_HEAL_BLOCK
    // {0} was prevented from healing due to {1}!
    PrintMessage 1054, TAG_NICKNAME_MOVE, BATTLER_CATEGORY_MSG_TEMP, BATTLER_CATEGORY_MSG_TEMP
    Wait 
    WaitButtonABTime 30
    Call BATTLE_SUBSCRIPT_SWITCH_IN_ABILITY_CHECK
    End 

_096:
    CheckAbility CHECK_OPCODE_HAVE, BATTLER_CATEGORY_MSG_ATTACKER, ABILITY_MAGIC_GUARD, _110
    Call BATTLE_SUBSCRIPT_UPDATE_HP
    // It sucked up the liquid ooze!
    PrintMessage 720, TAG_NONE
    Wait 
    WaitButtonABTime 30
    Call BATTLE_SUBSCRIPT_SWITCH_IN_ABILITY_CHECK
    End 

_110:
    // It sucked up the liquid ooze!
    PrintMessage 720, TAG_NONE
    Wait 
    WaitButtonABTime 30
    // {0}’s {1} suppressed {2}’s {3}!
    PrintMessage 727, TAG_NICKNAME_ABILITY_NICKNAME_ABILITY, BATTLER_CATEGORY_MSG_ATTACKER, BATTLER_CATEGORY_MSG_ATTACKER, BATTLER_CATEGORY_MSG_DEFENDER, BATTLER_CATEGORY_MSG_DEFENDER
    Wait 
    WaitButtonABTime 30
    Call BATTLE_SUBSCRIPT_SWITCH_IN_ABILITY_CHECK
    End 
